package com.kob.Etextbook.common.domain.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kob.Etextbook.common.domain.dos.CategoryDO;
import com.kob.Etextbook.common.utils.Response;

public interface CategoryMapper extends BaseMapper<CategoryDO> {
    /**
     * 根据标签名查询
     * @param categoryName
     * @return
     */
    default CategoryDO selectByName(String categoryName){
        LambdaQueryWrapper<CategoryDO> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(CategoryDO::getName,categoryName);
        return selectOne(wrapper);
    }
}
